#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from app import create_app
import os

# 从环境变量获取配置名称，如果没有则默认为development
config_name = os.environ.get('FLASK_CONFIG') or 'development'

# 创建应用实例
app = create_app(config_name)

if __name__ == '__main__':
    # 运行应用
    app.run(
        host=app.config.get('HOST', '0.0.0.0'),
        port=app.config.get('PORT', 5000),
        debug=app.config.get('DEBUG', True)
    )
